/** ###################################################################
**     Filename  : Config.H
**     Project   : Motologger_v2
**     Processor : MC9S12XA256CFU
**     Compiler  : CodeWarrior HCS12X C Compiler
**     Date/Time : 12/8/2009, 5:54 PM
**     Contents  :
**         User source code
**
**     (c) Copyright UNIS, a.s. 1997-2008
**     UNIS, a.s.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

#ifndef __Config_H
#define __Config_H

/* MODULE Config */

/*
 *  ConfigFileStruct.h
 *  motologger
 *
 *  Created by Glen Rhodes on 11/11/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */


//#pragma enum(1)
/*
typedef enum {
       speed,
       rpm,
       gear,
       tilt,
       lateralG
       
}tachSettingType;

typedef enum {
       alwaysOn,
       slowFlashing,
       fastFlashing,
       gearShift
}ledModeType;

typedef enum  {
       startNewRun,
       toggleTachModes
}userbuttonModeType;

*/

typedef enum{
       speed,             //tach out setting
       rpm,								//tach out setting
       gear,							//tach out setting
       tilt,							//tach out setting
       lateralG,					//tach out setting
       alwaysOn,					//lsd1 setting 
       slowFlashing,			//lsd1 setting
       fastFlashing,			//lsd1 setting
       gearShift,					//lsd1 setting
       startNewRun,				//fcn switch setting
       toggleTachModes,		//fcn switch setting
       num_choices
}settingsChoices;

typedef enum {
       tachPrimarySetting,	 //default tach output
       tachSecondarySetting, //secondary tach output
       ledMode,							 //mode for low side driver 1
       userbuttonMode,			 //mode for fcn sw
       gearShiftRPM,				 //tach light threshold if enabled in ledmode
			 speedSampling,
       rpmSampling,
       accelometerSampling,
       gpsSampling,
       vBattSampling,
       gearSampling,
       tireWidth,
       tireAspectRatio,
       tireRimDiameter,
       speedTicksPerRevolution,
       lastFileWritten,
       shutdownOk,           //ok to power down on ign off
       foneraStartNewFile,	 //
       outputSamplesEnabled, //global disable talking to fonera
       num_settings
}settingsType;


//const char*  setting_names[num_settings];

typedef struct _configFileType {
       unsigned short settings[num_settings];  
}configFileType;

typedef struct _logdataType {
       unsigned char data[128];
       
}logdataType;



typedef enum {
       configfile,
       data
}packetTypeEnum;

//the following is for fonera-iphone communication only
typedef union {
       
       char _byte[256];
       
       struct{
               unsigned char type;
               logdataType       content;
       }dataPacket;
       
       struct{
               unsigned char type;
               configFileType config;
       }configPacket;
       
}packetType;


void initSettings();

/* END ConfigFileStruct */



/* END Config */

#endif

